package spring.ribbon;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class ConfigRestTemplateBean {
    //配置负载均衡实现RestTemplate
    @Bean
    @LoadBalanced // 必须有，没有的时候无法通过eureka来调用
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}